<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
       <input type="file" id="file">
        <button id='btn'>1111111111111</button>


   <script>
       let ff=''
        file.onchange=(e)=>{
           ff=e.target.files[0]
        }

        btn.onclick=()=>{
            let xml=new XMLHttpRequest()
            console.log(xml)
            xml.open('post','http://localhost:7012/goods/upload',true)
            let form=new FormData()
            form.append('file',ff)
            xml.send(form)
            xml.onload=(e)=>{
                 console.log(e)
            }
        }
   </script>

</body>
</html>